From 1f3e6bc9eeccab935f345302b8445995eabf9be4 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 6 Apr 2004 15:22:43 +0000 Subject: [PATCH] Embarrassing crutch to allow intentional leak of xsi schema. --- gpsbabel/gpx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index 4aca5e38e..ff111654b 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -798,7 +798,14 @@ gpx_rd_init(const char *fname) cdatastr = vmem_alloc(1, 0); *((char *)cdatastr.mem) = '\0'; - xsi_schema_loc = xstrdup(DEFAULT_XSI_SCHEMA_LOC); + /* We don't use xstrdup here becuase we' know we don't free + * this across reads and we unlock the safety belt from the + * leak tester. + */ + xsi_schema_loc = strdup(DEFAULT_XSI_SCHEMA_LOC); + if (!xsi_schema_loc) { + fatal("gpx: Unable to allocate %d bytes of memory.\n", strlen(DEFAULT_XSI_SCHEMA_LOC) + 1); + } XML_SetElementHandler(psr, gpx_start, gpx_end); XML_SetCharacterDataHandler(psr, gpx_cdata); -- 2.30.2